package com.aoyama.collection.arraylist.v2;

import java.util.*;

/**
 * <p>
 * 使用泛型类模拟集合
 * </p>
 *
 * @author qingshan
 * @since 2021/3/31 4:17 下午
 */
public class Main {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("a");
        System.out.println(list.size());


        List<String> linkedList = new LinkedList<>();
        linkedList.add("aaa");
        ListIterator<String> iterator = linkedList.listIterator();
        
        System.out.println(linkedList.size());

        Map<String, String> map = new HashMap<>();
        map.put("a", "a");

        // -----------------自定义--------------------

        List_ arrayList_ = new ArrayList_();
        arrayList_.add("sting");
        System.out.println(arrayList_.size());

        List_ linkedList_ = new LinkedList_();
        linkedList_.add("linded string");
        System.out.println(linkedList_.size());
    }
}
